﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Windows.Forms;

namespace TankWin.Classes
{
    class GUIOption:GUI
    {
      public     override void Draw(System.Drawing.Graphics _G)
        {
            Bitmap _buffer = new Bitmap(300, 200);
            Graphics _gbuffer = Graphics.FromImage(_buffer);
            _gbuffer.Clear(frMain._Back_Color);

            Pen _pen = new Pen(Color.Silver, 10);
            _gbuffer.DrawRectangle(_pen, new Rectangle(0, 0, 300, 200));

            Font _font = new Font("Times New Roman", 20, FontStyle.Bold);
            _gbuffer.DrawString("SOUND: ", _font, Brushes.Silver, new PointF(15, 80));

            if (GUIPlay._hasSound)
            {
                _gbuffer.DrawImageUnscaled(global::TankWin.ImageTank.symbol_check, 160, 40);

            }
            else _gbuffer.DrawImageUnscaled(global::TankWin.ImageTank.symbol_delete, 160, 40);
            _G.DrawImageUnscaled(_buffer, 170, 220);
        }
       public  override void InputKey(System.Windows.Forms.Keys _key)
        {
            if (GUIMainMenu._move_player.IsLoadCompleted && GUIPlay._hasSound)
                GUIMainMenu._move_player.Play();
            switch (_key)
            {
                case Keys.Space:
                    GUIPlay._hasSound = !GUIPlay._hasSound;
                    break;
                case Keys.Up:
                    goto case Keys.Space;
                case Keys.Down:
                    goto case Keys.Space;
                case Keys.Enter:
                    if (GUIMainMenu._enter_player.IsLoadCompleted && GUIPlay._hasSound)
                        GUIMainMenu._enter_player.Play();
                    frMain._statusGUI = EStatusGUI.MainMenuGUI;
                    break;
                case Keys.Back:
                    goto case Keys.Enter;
                case Keys.Escape:
                    goto case Keys.Enter;
                    


            }
        }
    }
}
